import request from "@/utils/request";

export const login = (data) => {
    return request({
        method: 'POST',
        url: '/user/login',
        data
    })
}

export const register = (data) => {
    return request({
        method: 'POST',
        url: '/user/reg',
        data
    })
}


export const consultant = () => {
    return request({
        method: 'GET',
        url: '/user/consultant'
    })
}


export const forgetValidate = (params) => {
    return request({
        method: 'GET',
        url: '/user/forgetValidate',
        params
    })
}

export const changePassword = (params) => {
    return request({
        method: 'GET',
        url: '/user/changePassword',
        params
    })
}

/**
 * 申请成为咨询师
 * @param params
 * @returns {*}
 */
export const updateIdentity = (params) => {
    return request({
        method: 'PUT',
        url: '/user/updateIdentity',
        params
    })
}
/**
 * 根据邮箱获取用户信息
 * @param params 用户邮箱
 * @returns {*}
 */
export const getUserByEmail = (params) => {
    return request({
        method: 'GET',
        url: '/user/'+params
    })
}

